from pod.std import *

# not sure what to do with these right nwo..
class Compose(Macro):
    name = "compose"
    doctype = "html"
    
    def __init__(self, env, scope, filename, width=0, height=0):
        super(Compose, self).__init__()
        self.filename = filename
        self.width = width
        self.height = height
        self.surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, self.width, self.height)
        self.ctx = cairo.Context(self.surface)
        
    def __call__(self, content):
        self.surface.write_to_png(self.filename)
        return "<img src='%s'>" % self.filename
            
class Layer(Macro):
    name = "layer"
    doctype = "html"
    
    def __init__(self, env, scope):
        super(Layer, self).__init__()
        parent = scope[-1]
        self.ctx = parent.ctx
